home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 38 / Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso / -seriously_amiga- / programming / other / cyberxxxsrc / decoder / txt / utils.c < prev    next >
C/C++ Source or Header  |  1999-02-08  |  572b  |  32 lines

  1. /*
  2. sc:c/sc opt txt/Utils.c
  3. */
  4.  
  5. #include "Decode.h"
  6.  
  7. /* /// "mycopymem" */
  8. void __regargs mycopymem(ulong *src, ulong *dst, ulong size)
  9. {
  10.   ulong i=size;
  11.   uchar *bsrc, *bdst;
  12.  
  13.   while (i>=4) { *dst++=*src++; i-=4; };
  14.   bsrc=(uchar *)src;
  15.   bdst=(uchar *)dst;
  16.   while (i--) *bdst++=*bsrc++;
  17. }
  18. /* \\\ */
  19.  
  20. /* /// "mymemset" */
  21. void __regargs mymemset(ulong *mem, uchar val, ulong size)
  22. {
  23.   ulong i=size;
  24.   ulong v=(val << 24) || (val << 16) || (val << 8) || val;
  25.   uchar *bmem;
  26.  
  27.   while (i>=4) { *mem++=v; i-=4; };
  28.   bmem=(uchar *)mem;
  29.   while (i--) *bmem++=val;
  30. }
  31. /* \\\ */
  32.